package com.wiscamp.ninechapters.problems.enums;

/**
 * 通用问题模式枚举
 */
public enum CommonQuestionModes {
    UNKNOWN(10, "未知"),
    TRUE_FALSE(11, "判断"),

    MULTIPLE_CHOICE(12, "单项选择"),
    MULTIPLE_SELECTION(13, "多项选择"),
    CALCULATION(14, "计算"),
    COMPLETION(15, "填空"),
    COLUMN_CALCULATION(16, "竖式计算"),
    GEOMETRY_CALCULATION(17, "几何计算"),
    GEOMETRY_COMPLETION(18, "几何填空"),
    WORD(19, "文字应用"),
    UNIT_CONVERSION(20, "单位转换"),
    FORMULA_SOLVE(21, "解方程不等式"),
    PROVE(22, "推理证明"),
    RATIO_PROPORTION(23, "比与比例"),
    PROBABILITY(24, "概率"),
    STATISTICS(25, "统计"),
    FACTORS_MULTIPLES(26, "因数倍数"),
    DRAWING(27, "绘图"),
    SHORT_ANSWER(28, "简答");

    private final int value;

    private final String name;

    CommonQuestionModes(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    // PROBABILITY STATISTICS  COMPOSITE-
    public static CommonQuestionModes valueOf(int value) {
        return switch (value) {
            case 10 -> CommonQuestionModes.UNKNOWN;
            case 11 -> CommonQuestionModes.TRUE_FALSE;
            case 12 -> CommonQuestionModes.MULTIPLE_CHOICE;
            case 13 -> CommonQuestionModes.MULTIPLE_SELECTION;
            case 14 -> CommonQuestionModes.CALCULATION;
            case 15 -> CommonQuestionModes.COMPLETION;
            case 16 -> CommonQuestionModes.COLUMN_CALCULATION;
            case 17 -> CommonQuestionModes.GEOMETRY_CALCULATION;
            case 18 -> CommonQuestionModes.GEOMETRY_COMPLETION;
            case 19 -> CommonQuestionModes.WORD;
            case 20 -> CommonQuestionModes.UNIT_CONVERSION;
            case 21 -> CommonQuestionModes.FORMULA_SOLVE;
            case 22 -> CommonQuestionModes.PROVE;
            case 23 -> CommonQuestionModes.RATIO_PROPORTION;
            case 24 -> CommonQuestionModes.PROBABILITY;
            case 25 -> CommonQuestionModes.STATISTICS;
            case 26 -> CommonQuestionModes.FACTORS_MULTIPLES;
            case 27 -> CommonQuestionModes.DRAWING;
            default -> null;
        };
    }
}
